package forum.communication;

import forum.server.controller.ForumFacadeInt;
import forum.server.exceptions.DatabaseException;

/**
 * 
 * @author mirskyil
 */
public class GetConnectedUsersMessage extends ClientMessage {

	private static final long serialVersionUID = 2565709600693315374L;

	
	@Override
	public ServerResponse doOperation(ForumFacadeInt forum) {
		ServerResponse ret;
		
		try {
			ret = new ServerResponse(forum.getConnectedUsers(), true);
		} catch (DatabaseException ex) {
			ret = new ServerResponse(ex.getMessage(), true);
		}
		
		return ret;
	}
	

}

